<?php
/* @var $this SiteController */

$this->layout = '//layouts/site_view';
$this->pageTitle=$tag.' - 标签列表';
$this->metaArgs = array(
    'keywords'=>$tag,
    'description'=>$this->pageTitle
    );
?>


<div class='container-fluid'>
	<div class='row-fluid'>
		<div class='span9 left-container'>
			<div class='divider'></div>
			<h4>{<?php echo $tag;?>} - 标签列表</h4>
			<div class='divider'></div>
			
			<?php foreach($models as $k=>$v):?>
				<section class='well'>
					<h4>
                        <a target="_blank" href='<?php echo Yii::app()->createUrl('site/view',array('id'=>$v->id));?>'>
                            <?php echo $v->title;?>
                        </a>
					</h4>
					<div class='article' style='word-break: break-all;'>
						<?php echo HelperString::sysSubStr(strip_tags($v->description), 2500, true);?>
						<a href='<?php echo Yii::app()->createUrl('site/view',array('id'=>$v->id));?>'>阅读文章 》》》</a>
					</div>
				
					<div class='pull-right' style='margin-top:10px;text-align:right'>
						<span class=''><strong>作者:</strong></span>
						<span class='label'>
							<?php echo $v->user->username;?>
						</span>
						<span class=''>|</span>
						<span class=''><strong>分类:</strong></span>
						<span class='label'>
							<?php echo CHtml::encode($v->type->name);?>
						</span>
						<span class=''>|</span>
						<span class=''><strong>阅读数:</strong></span>
						<span class="label">
							<?php echo $v->read_sum;?>
						</span>
						<span class=''>|</span>
						<span class=''><strong>评论数:</strong></span>
						<span class="label"><a href='<?php echo Yii::app()->createUrl('site/view',array('id'=>$v->id));?>#disqus_thread'></a></span>
					</div>
				</section>
			<?php endforeach;?>
			
			<div class="pagination">
                <?php 
                $this->widget('CLinkPager', array(
                    'pages' => $pages,
                    'cssFile'=>'',
                    'firstPageCssClass'=>'hidden',
                    'firstPageLabel'=>'',
                    'internalPageCssClass'=>'',
                    'lastPageCssClass'=>'hidden',
                    'lastPageLabel'=>'',
                    'previousPageCssClass'=>'previous',
                    'prevPageLabel'=>'',
                    'nextPageLabel'=>'',
                    'selectedPageCssClass'=>'active',
                    'hiddenPageCssClass'=>'',
                    'header'=>'',
                    'htmlOptions'=>array(
                        'class'=>''
                        )
                    )); 
                ?>         
			</div>
		</div>
		
	
		<div class='span3 right-container'>
			<?php $this->beginWidget('LeftNavWidget');?><?php $this->endWidget(); ?>
		</div>
	</div>
</div>

<!-- 评论数插件 -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'gowhich'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
    var s = document.createElement('script'); s.async = true;
    s.type = 'text/javascript';
    s.src = '//' + disqus_shortname + '.disqus.com/count.js';
    (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>